void main() {
  customException();
}

class AmtException implements Exception {
  late num _a;
  String get errMsg => 'Amount should be greater than zero';
}

void customException() {
  try {
    withDrawAmt(-1);

  }
 on AmtException catch(e) {
    print(e.errMsg);
  }
  finally {
    print('Ending requested operation.....');
  }
}

void withDrawAmt(int amt) {
  if(amt < 0) {
    throw AmtException();
  }
}
